<?php

require_once 'Zend/Exception.php';

class Base_Exception extends Zend_Exception
{
    public function setFormError(Zend_Form $form)
    {
        $error = $this->translateError();
        
        //add error
        if ($form->getElement($error['key'])) {
            return $form->getElement($error['key'])->addError($error['message']);
        } else {
            throw new Zend_Exception(
                'ERROR['.$this->getCode().']: '.$error['message'], $this->getCode(), $this->getPrevious()
            );
        }
    }
    
    protected function translateError()
    {
    }
}